package com.careercup.question.id22415667;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Solution {
	/**
	 * Find pairs of nums that add upto given number.
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt(), a[] = new int[N];
		for(int i = 0; i < N; i++)
			a[i] = in.nextInt();
		int S = in.nextInt(), i;
		Set<Integer> set = new HashSet<Integer>();
		for(i = 0; i < N; i++) {
			if(set.contains(S - a[i])) {
				System.out.println(S - a[i] + " and " + a[i]);
				break;
			} else
				set.add(a[i]);
		}
		if(i == N)
			System.out.println("No pair found");
	}
}
